package com.bwie.controller;
import com.bwie.pojo.Brand;
import com.bwie.service.BrandService;
import com.bwie.service.impl.BrandServiceImpl;
import com.bwie.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
* 品牌表(t_brand)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/shop/index/")
@Api(tags = "商品模块")
public class BrandController {
/**
* 服务对象
*/
    @Autowired
    private BrandService brandService;



    @ApiOperation("【品牌】列表分页条件查询")
    @PostMapping("getBrandList")
    public R getBrandList(@RequestBody Brand brand){
        return brandService.getBrandList(brand);
    }


    @ApiOperation("添加品牌信息")
    @PostMapping("saveBrand")
    public R saveBrand(@RequestBody @Validated Brand brand){
        return brandService.saveBrand(brand);
    }


    @ApiOperation("修改状态")
    @PostMapping("updateBrand")
    public R updateBrand(@RequestBody Brand brand){
        return brandService.updateBrand(brand);
    }
    @ApiOperation("删除品牌信息")
    @PostMapping("deleteBrandById")
    public R deleteBrandById(@RequestBody  Brand brand){
        return brandService.deleteBrandById(brand);
    }
    @ApiOperation("批量删除品牌信息")
    @PostMapping("deleteBatchByIds")
    public R deleteBatchByIds(@RequestBody List<Brand> ids){
        return brandService.deleteBatchByIds(ids);
    }



}
